package my.servlet.util;

import java.util.HashMap;
import java.util.Map;

public class ParameterMap extends HashMap<String, Object> {

    public ParameterMap() {
        super();
    }

    public ParameterMap(int initialCapacity) {
        super(initialCapacity);
    }

    public ParameterMap(int initialCapacity, float loadFactor) {
        super(initialCapacity, loadFactor);
    }

    public ParameterMap(Map<String, String> map) {
        super(map);
    }

    private boolean locked = false;

    public boolean isLocked() {
        return (this.locked);
    }

    public void setLocked(boolean locked) {
        this.locked = locked;
    }

    public void clear() {
        if (locked)
            throw new IllegalStateException(("parameterMap.locked"));
        super.clear();
    }

    public Object put(String key, Object value) {
        if (locked)
            throw new IllegalStateException(("parameterMap.locked"));
        return (super.put(key, value));
    }

    public void putAll(Map<? extends String, ? extends Object> map) {
        if (locked)
            throw new IllegalStateException(("parameterMap.locked"));
        super.putAll(map);
    }

    public Object remove(String key) {
        if (locked)
            throw new IllegalStateException(("parameterMap.locked"));
        return (super.remove(key));
    }
}
